package components.managers
{
	import flash.net.LocalConnection;
	import flash.utils.clearTimeout;
	import flash.utils.setInterval;

	public class GCManager
	{
		private static var _setIntervalID:int;
		
		public function GCManager()
		{
			
		}
		
		/**
		 * 启动垃圾清理定时器
		 * @param delay 分钟
		 * 
		 */
		public static function startGcTimers(delay:uint=1000):void
		{
			stopGcTimers();
			_setIntervalID=setInterval(gc,delay);
		}
		
		public static function stopGcTimers():void
		{
			clearTimeout(_setIntervalID);
			_setIntervalID=0;
		}
		
		public static function gc():void
		{
			var str:String="士大夫撒地方士大夫撒地方是否第三方士大夫撒地方放松放松反对萨芬第三方士大夫撒地方";
			for (var i:int = 0; i <20; i++) 
			{
				str+=str;	
			}
			trace("清理内存");
		}
	}
}